package main

import (
	"github.com/astaxie/goredis"
)


//https://github.com/astaxie/goredis/blob/master/redis.go
func main(){

	var client goredis.Client

	client.Addr = "localhost:6379"

	// 1
/*	err := client.Set("test",[]byte("hello redis"))

	if err != nil{
		panic(err)
	}

	res, err := client.Get("test")

	if err != nil{
		panic(err)
	}

	fmt.Println(string(res))*/

	//2.test hmset
/*	f :=make(map[string]interface{})
	f["name"] = "zhangsan"
	f["age"] = 66.66
	f["sex"] = "male"

	err := client.Hmset("test_hash", f)

	if err != nil {
		panic(err)
	}*/

	//3.test zadd
	_, err := client.Zadd("test_zset", []byte("redis"), 66.66)
	if err != nil {
		panic(err)
	}

}